package day02;

public class homework02 {
    public static void main(String[] args) {
        int[] arr=new int[]{1,44,51,75,12,34};
        search_num(arr,51);
    }

   public static void search_num(int[] arr,int num) {
        int ok=0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i]==num) {
                ok = 1;
                System.out.println("存在这个数，他是第"+(i+1)+"个数");
                break;
            }
        }
        if (ok == 0) {
            System.out.println("不存在这个数");
        }
    }
}
